#ifndef __IMA_CONSTANTS_H__
#define __IMA_CONSTANTS_H__

/******************************************************************************
 * 
******************************************************************************/
#define IMA_PORT 8001
#define IMA_JSON_KEY_APP_SERVER_HOST			"appserverhost"
#define IMA_JSON_KEY_APP_SERVER_PORT			"appserverport"
#define IMA_CONF_FILE	"./ima.conf"
#define IMA_NUM_DB_CONN_RETRIES	5
#define IMA_DB_CONN_TIMEOUT		10	//in seconds
#define IMA_APP_NAME							"iamalive"

/******************************************************************************
 * JSON #defines
******************************************************************************/
#define IMA_JSON_INDENT_SIZE						2
#define IMA_JSON_ID_DELIMITER						','

#define IMA_JSON_KEY_PORT							"port"
#define IMA_JSON_KEY_HOSTNAME						"hostname"
#define IMA_JSON_KEY_NAME 							"name"
#define IMA_JSON_KEY_USERNAME 						"username"
#define IMA_JSON_KEY_PASSWORD						"password"
#define IMA_JSON_KEY_DB								"db"
#define IMA_JSON_KEY_MESSAGE_QUEUE					"mq"
#define IMA_JSON_KEY_XMPPIDQNAME					"xmppidqname"
#define IMA_JSON_KEY_IMQKEY						"im"
#define IMA_JSON_KEY_REGCONFCODEQKEY			"confcode"
#define IMA_JSON_KEY_NEWPASSWORDQKEY			"newpassword"
#define IMA_JSON_KEY_TYPE							"type"
#define IMA_JSON_KEY_ID								"id"
#define IMA_JSON_KEY_MESSAGE						"message"
#define IMA_JSON_KEY_STATUS_MESSAGES				"status-messages"
#define IMA_JSON_KEY_SOURCE							"source"
#define IMA_JSON_KEY_RESULT							"result"
#define IMA_JSON_KEY_STATUS_CODE					"status-code"
#define IMA_JSON_KEY_ACTION							"action"
#define IMA_JSON_KEY_DETAILS						"details"
#define IMA_JSON_KEY_USERID							"userid"
#define IMA_JSON_KEY_EMAIL							"email"
#define IMA_JSON_KEY_IM_ID							"im-id"
#define IMA_JSON_KEY_IM_SERVICE						"im-service"
#define IMA_JSON_KEY_PASSWORD						"password"
#define IMA_JSON_KEY_NEW_PASSWORD					"new-password"
#define IMA_JSON_KEY_NAME							"name"
#define IMA_JSON_KEY_GENDER							"gender"
#define IMA_JSON_KEY_ADDRESS						"address"
#define IMA_JSON_KEY_CITY							"city"
#define IMA_JSON_KEY_STATE							"state"
#define IMA_JSON_KEY_COUNTRY						"country"
#define IMA_JSON_KEY_ZIP							"zip"
#define IMA_JSON_KEY_PHONE							"phone"
#define IMA_JSON_KEY_DOB							"dob"
#define IMA_JSON_KEY_DOJ							"doj"
#define IMA_JSON_KEY_INFO							"info"
#define IMA_JSON_KEY_INFO_ID						"info-id"
#define IMA_JSON_KEY_MEDIA							"media"
#define IMA_JSON_KEY_EXPIRY_DATE					"expiry-date"
#define IMA_JSON_KEY_TTL							"ttl"
#define IMA_JSON_KEY_RECIPIENTS					"recipients"
#define IMA_JSON_KEY_RECIPIENTSTODISASSOCIATE	"recipientstodisassociate"
#define IMA_JSON_KEY_RECIPIENT					"recipient"
#define IMA_JSON_KEY_RECIPIENT_ID				"recipient-id"
#define IMA_JSON_KEY_RELATION_WITH_OWNER		"relation-with-owner"
#define IMA_JSON_KEY_USER_DETAILS				"user-details"
#define IMA_JSON_KEY_RECIPIENT_LIST					"recipient-list"
#define IMA_JSON_KEY_INFO_LIST					"info-list"
#define IMA_JSON_KEY_CONFCODE						"confcode"
#define IMA_JSON_KEY_SUBJECT					"subject"
#define IMA_JSON_KEY_BODY						"body"
#define IMA_JSON_KEY_USERFEEDBACK				"userfeedback"

#define IMA_JSON_VALUE_UNKNOWN					-1
#define IMA_JSON_VALUE_STR_UNKNOWN				"unknown"
#define IMA_JSON_VALUE_RESPONSE					"response"
#define IMA_JSON_VALUE_APPSERVER					"appserver"
#define IMA_JSON_VALUE_APP							"app"
#define IMA_JSON_VALUE_BOT							"bot"
#define IMA_JSON_VALUE_INVALID_REQUEST			"invalid-request"
#define IMA_JSON_VALUE_WEB_SERVER				"web-server"
#define IMA_JSON_VALUE_REGISTER					"register"
#define IMA_JSON_VALUE_LOGIN						"login"
#define IMA_JSON_VALUE_ADD_INFO					"add-info"
#define IMA_JSON_VALUE_DELETE_INFO				"delete-info"
#define IMA_JSON_VALUE_UPDATE_INFO				"update-info"
#define IMA_JSON_VALUE_ADD_INFO_RECIPIENT		"add-info-recipient"
#define IMA_JSON_VALUE_UPDATE_INFO_RECIPIENT	"update-info-recipient"
#define IMA_JSON_VALUE_DELETE_INFO_RECIPIENT	"delete-info-recipient"
#define IMA_JSON_VALUE_UPDATE_LAST_ACCESS_TIME	"update-last-access-time"
#define IMA_JSON_VALUE_REQUEST					"request"
#define IMA_JSON_VALUE_SUCCESS					0
#define IMA_JSON_VALUE_FAILURE					-1

#define	IMA_JSON_VALUE_NOT_VALID_JSON			"Not a valid JSON string"
#define	IMA_JSON_VALUE_NOT_VALID_REQUEST		"Not a valid request"

enum IMA_ACTION_REQUESTED {
	IMA_ACTION_REGISTER = 1,
	IMA_ACTION_CONFIRM_REGISTRATION = 2,
	IMA_ACTION_UPDATE_USER_DETAILS = 3,
	IMA_ACTION_LOGIN = 4,
	IMA_ACTION_ADD_INFO = 5,
	IMA_ACTION_UPDATE_INFO = 6,
	IMA_ACTION_DELETE_INFO = 7,
	IMA_ACTION_ADD_INFO_RECIPIENTS = 8,
	IMA_ACTION_UPDATE_RECIPIENT = 9,
	IMA_ACTION_DELETE_INFO_RECIPIENT = 10,
	IMA_ACTION_UPDATE_LAST_ACCESS_TIME = 11,
	IMA_ACTION_CHANGE_PASSWORD = 12,
	IMA_ACTION_ADD_RECIPIENT = 13,
	IMA_ACTION_DELETE_RECIPIENT = 14,
	IMA_ACTION_GET_USER_DETAILS,
	IMA_ACTION_GET_RECIPIENTS_LIST,
	IMA_ACTION_GET_INFO_LIST,
	IMA_ACTION_FETCH_USER_DATA,
	IMA_ACTION_FORGOT_PASSWORD,
	IMA_ACTION_USER_FEEDBACK
};



enum IMA_INFO_MEDIA_TYPE {
	IMA_INFO_MEDIA_TEXT	= 0,
	IMA_INFO_MEDIA_TEXT_FILE = 1,
	IMA_INFO_MEDIA_PIC_FILE = 2,
	IMA_INFO_MEDIA_AUDIO_FILE = 3,
	IMA_INFO_MEDIA_VIDEO_FILE = 4
};

/******************************************************************************
* Registration status
******************************************************************************/
#define IMA_REGN_CONF_PENDING 	'P'
#define IMA_REGN_CONFIRMED			'C'
#define IMA_REGN_INACTIVATED		'I'
#define IMA_REGN_DELETED			'D'
#define IMA_REGN_NOT_REGISTERED	'U'

/******************************************************************************
* Response Codes
*******************************************************************************/
enum IMA_RESPONSE_CODES {
	IMA_RESPONSE_SUCCESS = 0,
	IMA_RESPONSE_FAILURE = -1,
	IMA_RESPONSE_REGISTRATION_CONFIRMATION_PENDING = -106
};


#endif	//__IMA_CONSTANTS_H__
